//
//  EsLibraryModel.swift
//
//  Created by 邱仙凯 on 2022/8/24
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public struct ZyaEsLibraryModel: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let zStorageNm = "z_storage_nm"
    static let zNumber = "z_number"
    static let sNumber = "s_number"
    static let zGoodsUnit = "z_goods_unit"
    static let zDate = "z_date"
    static let zZcNm = "z_zc_nm"
    static let zNo = "z_no"
    static let sGoodsUnit = "s_goods_unit"
  }

  // MARK: Properties
  public var zStorageNm: String?
  public var zNumber: String?
  public var sNumber: String?
  public var zGoodsUnit: String?
  public var zDate: String?
  public var zZcNm: String?
  public var zNo: String?
  public var sGoodsUnit: String?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public mutating func mapping(map: Map) {
    zStorageNm <- map[SerializationKeys.zStorageNm]
    zNumber <- (map[SerializationKeys.zNumber],StringTransform_test())
    sNumber <- (map[SerializationKeys.sNumber],StringTransform_test())
    zGoodsUnit <- map[SerializationKeys.zGoodsUnit]
    zDate <- map[SerializationKeys.zDate]
    zZcNm <- map[SerializationKeys.zZcNm]
    zNo <- map[SerializationKeys.zNo]
    sGoodsUnit <- map[SerializationKeys.sGoodsUnit]
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = zStorageNm { dictionary[SerializationKeys.zStorageNm] = value }
    if let value = zNumber { dictionary[SerializationKeys.zNumber] = value }
    if let value = sNumber { dictionary[SerializationKeys.sNumber] = value }
    if let value = zGoodsUnit { dictionary[SerializationKeys.zGoodsUnit] = value }
    if let value = zDate { dictionary[SerializationKeys.zDate] = value }
    if let value = zZcNm { dictionary[SerializationKeys.zZcNm] = value }
    if let value = zNo { dictionary[SerializationKeys.zNo] = value }
    if let value = sGoodsUnit { dictionary[SerializationKeys.sGoodsUnit] = value }
    return dictionary
  }

}
